// Package day_14_two_point 11-189
// @Title day_14_two_point
// @Description
// @Author  == 琳琳也叫王木木 ==  2021/11/1 15:01
// @Create  2021/11/1 15:01
package day_14_two_point

import "fmt"

func Test11() {
	nums := []int{1, 2, 3, 4, 5, 6, 7}
	fmt.Println(nums)
	rotate(nums, 3)
	fmt.Println(nums)
}

func rotate(nums []int, k int) {
	fast, slow := 0, 0
	for i := 0; i <= k; i++ {
		fast++
	}

	for i := fast; i < len(nums); i++ {
		nums[i], nums[slow] = nums[slow], nums[i]
		slow++
	}
}
